package com.java.zjx.action;

import javax.servlet.http.Cookie;
import javax.servlet.http.HttpServletRequest;

import org.apache.struts2.ServletActionContext;

import com.opensymphony.xwork2.ActionSupport;

public class ShowLogin extends ActionSupport {
	private String userName;
	private String password;
	public String execute() throws Exception {
		System.out.println("login start....");
//		HttpServletRequest request = ServletActionContext.getRequest();
//		Cookie[] cs = request.getCookies();
//		String uname = null;
//  		String upass = null;
//  		for(int i=0;i<cs.length; i++){
//  			System.out.println(cs[i].getName() + ", " + cs[i].getValue());
//  			if(cs[i].getName().equals("uname")){
//  				uname = cs[i].getValue();
//  				System.out.println("ok:"+uname);
//  				continue;
//  			}
//  			if(cs[i].getName().equals("upass")){
//  				upass = cs[i].getValue();
//  				continue;
//  			}
//  			if(uname !=null && upass!=null){
//  				break;
//  			}
//  		}
  		System.out.println("login end......");
		return SUCCESS;
	}
	public String getUserName() {
		return userName;
	}
	public String getPassword() {
		return password;
	}
	
	
	
}
